import request from '@/utils/request'

export function createOrUpdate(data) {
  return request({
    url: '/menus/createOrUpdate',
    method: 'post',
    data
  })
}

export function createOrUpdateRole(data) {
  return request({
    url: '/companyRole/createOrEdit',
    method: 'post',
    data
  })
}

export function createOrUpdateUser(data) {
  return request({
    url: '/companyUser/create',
    method: 'post',
    data
  })
}

export function roleAddMenus(data) {
  return request({
    url: '/role/roleAddMenus',
    method: 'post',
    data
  })
}

export function allList() {
  return request({
    url: '/menus/allList',
    method: 'get',
  })
}


export function roleMenusList(id, type, marked) {
  return request({
    url: '/role/roleMenusList',
    method: 'get',
    params: {id, type, marked}
  })
}

export function getList() {
  return request({
    url: '/menus/list',
    method: 'get',
  })
}

export function getUserList() {
  return request({
    url: '/companyUser/list',
    method: 'get',
  })
}

export function getRoleList() {
  return request({
    url: '/companyRole/list',
    method: 'get',
  })
}

export function deleteMenus(data) {
  return request({
    url: '/menus/delete',
    method: 'post',
    data
  })
}

export function deleteRole(data) {
  return request({
    url: '/companyRole/delete',
    method: 'post',
    data
  })
}

export function deleteUser(data) {
  return request({
    url: '/companyUser/delete',
    method: 'post',
    data
  })
}

